package cn.platform.mapper;

import cn.platform.entity.Admin;
import cn.platform.entity.UserAccount;
import cn.platform.request.AdminRequest;
import cn.platform.request.IdentifyRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AdminMapper {
    // 登录身份验证
    List<UserAccount> identify(IdentifyRequest req);

    // 查询
    List<Admin> listAdmin(AdminRequest req);

    // 新增
    void insertAdmin(AdminRequest req);

    // 更新，用id找，其余参数为更新内容，null值不更新
    void updateAdmin(AdminRequest req);

    // 删除，用id找
    void deleteAdmin(AdminRequest req);

    @Select("select real_name from jxt_admins where id=#{pubId}")
    String getNameById(Integer pubId);
}
